<!DOCTYPE html>
<html lang="en">
<head>
    <link rel="shortcut icon" href="#"/>
    <meta charset="UTF-8">
    <title>Title</title>
    <link rel="stylesheet" type="text/css" href="css/mobileSelect.css">
    <script src="js/mobileSelect.js" type="text/javascript"></script>
    <script src="https://cdn.bootcss.com/jquery/1.10.2/jquery.min.js" ></script>

</head>
<body>
<button onclick="test()">bbbbb</button>
<div id="trigger2" style="width: 100px;height: 200px;background-color: #1e83d3">


</div>
</body>
<script type="text/javascript">
    var t=new Date();
    var year=t.getFullYear();
    var month=t.getMonth()+1;
    var nextMonth=t.getMonth()+2;
    var dayOne=t.getDate();
    var dayTwo=t.getDate()+1;
    var dayThree=t.getDate()+2;
    var dayFour=t.getDate()+3;
    var dayFive=t.getDate()+4;
    var daySix=t.getDate()+5;
    var daySeven=t.getDate()+6;
    const mobileSelect2 = new MobileSelect({
        trigger: '#trigger2',
        title: '地区选择',
        wheels: [
            {data:[
                    {id:'1',value:'年'},
                    {id:'2',value:year},
                ]},
            {data:[
                    {id:'1',value:'月'},
                    {id:'2',value:month},
                    {id:'3',value:nextMonth},
                ]},
            {data:[
                    {id:'1',value:'日'},
                    {id:'2',value:dayOne},
                    {id:'3',value:dayTwo},
                    {id:'4',value:dayThree},
                    {id:'5',value:dayFour},
                    {id:'6',value:dayFive},
                    {id:'7',value:daySix},
                    {id:'8',value:daySeven},

                ]}
        ],
        position:[1,1,1],
        callback:function(indexArr, data){
            console.log(data); //返回选中的json数据
            var d=data;
            alert(d[0].id+"|||||"+d[0].value);



        }
    });
    function test(){
       mobileSelect2.show();
    }
</script>

</html>